﻿@model Project_1.Models.Question
@{
    if (ViewBag.Question != null)
    {
        ViewBag.Title = ViewBag.Question.Title;

    <h2>@ViewBag.Question.Title</h2>
    @Html.Raw(ViewBag.Question.Content)
    <p>In : @ViewBag.Category.Name</p>
    <p>By : @Html.ActionLink((string)ViewBag.Question.Username, "ViewInformation", "User", new { id = (string)ViewBag.Question.Username }, null)    </p>
    <p>Create Time : @ViewBag.Question.CreateTime</p>
        if (Session["Username"] != null)
        {
            if (ViewBag.Followed)
            {
    @Html.ActionLink("Unfollow", "Follow", "Question", new { id = ViewBag.Question.Id }, null)
            }
            else
            {
    @Html.ActionLink("Follow", "Follow", "Question", new { id = ViewBag.Question.Id }, null)
            }
        }
        
    
    <hr />
    <p>Ans below</p>
    
    }
    else
    {
        ViewBag.Title = ViewBag.Error;   
    <div>@ViewBag.Error</div>
    }
    //Link to send message if Session != null
}
